import React, { Component } from 'react';
import {
    View,
    Text,
    TouchableOpacity,
} from 'react-native';

import { Salarylist_style as styles } from '../../../../../styles';


export default class Salary_in extends Component {

    constructor(props) {
        super(props);
    };

    render() {
        return (
            <View>
                <TouchableOpacity activeOpacity={1} onPress={() => { this.choose(this.props.rowData) }}>
                    {this.props.rowData.state ?
                        <Text style={styles.sal_text2}>{this.props.rowData.body}</Text>
                        :
                        <Text style={styles.sal_text1}>{this.props.rowData.body}</Text>
                    }
                </TouchableOpacity>
            </View>
        )
    }

    choose(a) {
        this.props.change(a.body);
        this.props._salary(a.key);
    }
}